import './assets/main.css'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import axiosInstance from './plugin/axiosInstance'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'


import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons'
import { far } from '@fortawesome/free-regular-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons'
import { FontAwesomeIcon, FontAwesomeLayers, FontAwesomeLayersText } from '@fortawesome/vue-fontawesome'

// 将所有的 FontAwesome 图标添加到库中
library.add(fas, far, fab)

const app = createApp(App)

// 注册 FontAwesome 组件
app.component('font-awesome-icon', FontAwesomeIcon)
app.component('font-awesome-layers', FontAwesomeLayers)
app.component('font-awesome-layers-text', FontAwesomeLayersText)

// 使用 Vue Router
app.use(router)

app.use(ElementPlus)

// 将 axios 实例作为全局属性注入
app.provide('$axios', axiosInstance)

// 挂载应用
app.mount('#app')
